package com.enhe.gck.pojo;

import com.alibaba.fastjson.annotation.JSONField;
import com.enhe.gck.CarbonRelationType;
import com.enhe.gck.item.WeighHWANE16720Item;
import com.kuangkie.carbon.common.BytesInfoVO;
import com.kuangkie.carbon.record.Updatable;
import com.kuangkie.carbon.record.annotation.Attribute;
import com.kuangkie.carbon.record.annotation.CarbonRecord;
import com.kuangkie.carbon.record.annotation.RecordCode;
import com.kuangkie.carbon.record.annotation.Relation;
import com.kuangkie.carbon.uid.model.UidManager;
import lombok.Data;

import java.math.BigDecimal;
import java.time.LocalDateTime;

// 过磅信息
@Data
@CarbonRecord("hwane16720")
public class WeighOther implements Updatable {
    @JSONField(name = "唯一编码")
    @RecordCode
    private Long id = UidManager.getLongUID();

    // 过磅号
    @JSONField(name = "过磅号")
    @Attribute("hwan16722")
    private String number;

    // 皮重
    @JSONField(name = "皮重")
    @Attribute("hwan16725")
    private Double weightTare;

    // 毛重
    @JSONField(name = "毛重")
    @Attribute("hwan16726")
    private Double weightGross;

    // 净重
    @JSONField(name = "净重")
    @Attribute("hwan16727")
    private Double weight;

    // 过磅次数
    @JSONField(name = "过磅次数")
    @Attribute("hwan16733")
    private Integer frequency;

    // 是否正常
    @JSONField(name = "是否正常")
    @Attribute("hwan17323")
    private Boolean isOk;

    // 订单号
    @JSONField(name = "订单号")
    @Attribute("hwan18125")
    private String orderNumber;

    @JSONField(name = "命令")
    @Attribute("hwan18251")
    private String command;

    @JSONField(name = "过磅时间")
    @Attribute("hwan18407")
    private LocalDateTime passTime;

    @JSONField(name = "原因")
    @Attribute("hwan18530")
    private String remark;

    @JSONField(name = "实际过磅毛重")
    @Attribute("hwan20256")
    private BigDecimal actualWeightGross;

    @JSONField(name = "称重抓拍图片")
    @Attribute(WeighHWANE16720Item.基本属性组_称重抓拍图片)
    private BytesInfoVO capturePic;

    @JSONField(name = "称重抓拍图片2")
    @Attribute(WeighHWANE16720Item.基本属性组_称重抓拍图片2)
    private BytesInfoVO capturePic2;

    @JSONField(name = "称重抓拍图片3")
    @Attribute(WeighHWANE16720Item.基本属性组_称重抓拍图片3)
    private BytesInfoVO capturePic3;

    // 车牌号
    @JSONField(name="车牌号")
    @Attribute("hwan20399")
    private String carNumber;

    @Attribute(WeighHWANE16720Item.基本属性组_产品名称)
    private String productName;

    // 装车道id
    @Attribute(WeighHWANE16720Item.基本属性组_装车车道ID)
    private String laneId;
    // 装车道号
    @Attribute(WeighHWANE16720Item.基本属性组_装车车道号)
    private String laneNo;
    // 装车道名称
    @Attribute(WeighHWANE16720Item.基本属性组_装车道名称)
    private String laneName;
    // 过磅异常类型
    @Attribute(WeighHWANE16720Item.基本属性组_过磅异常类型)
    private String exceptionType;
    // 过磅异常数量
    @Attribute(WeighHWANE16720Item.基本属性组_过磅异常数量)
    private Integer exceptionNumber;
    // 开始装车时间
    @Attribute(WeighHWANE16720Item.基本属性组_开始装车时间)
    private LocalDateTime loadStartTime;
    // 结束装车时间
    @Attribute(WeighHWANE16720Item.基本属性组_结束装车时间)
    private LocalDateTime loadEndTime;

    @Relation(value = CarbonRelationType.RR_过磅信息_过一磅信息所属供货订单_供货订单, optType = "写")
    private Long supplyOrderId1;
    @Relation(value = CarbonRelationType.RR_过磅信息_过二磅信息所属供货订单_供货订单, optType = "写")
    private Long supplyOrderId2;

    @Override
    public String getRecordCode() {
        return this.id == null ? null : this.id.toString();
    }
}
